<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title>Flex布局属性演示</title>
  <link rel="stylesheet" href="css/style.css">
</head>

<body>
  <div class="principal">
    <h2>flex父容器属性</h2>
    <div class="control">
      <h4><a href="http://w3.unpocodetodo.info/css3/flex-direction.php">flex-direction</a> <small>主轴方向</small></h4>
      <!--flex-direction: row | row-reverse | column | column-reverse;-->
      <div class="radio">
        <input name="flex-direction" type="radio" class="flex-direction" id="R11" value="row" checked><label
          for="R11">row:从左到右</label>
        <input name="flex-direction" type="radio" class="flex-direction" id="R12" value="row-reverse"><label
          for="R12">row-reverse:从右到左</label>
        <input name="flex-direction" type="radio" class="flex-direction" id="R13" value="column"><label
          for="R13">column:从上到下</label>
        <input name="flex-direction" type="radio" class="flex-direction" id="R14" value="column-reverse"><label
          for="R14">column-reverse:从下到上</label>
      </div>
    </div>
    <div class="flex-container" id="direction">
      <div class="item" data-color="2a80b9">
        <p>1</p>
      </div>
      <div class="item" data-color="8f44ad">
        <p>2</p>
      </div>
      <div class="item" data-color="16a086">
        <p>3</p>
      </div>
      <div class="item" data-color="f1c40f">
        <p>4</p>
      </div>
      <div class="item" data-color="e77e23">
        <p>5</p>
      </div>
    </div>

    <div class="control">
      <h4><a href="http://w3.unpocodetodo.info/css3/flex-wrap.php">flex-wrap</a> <small>子元素是否换行</small></h4>
      <!--nowrap | wrap | wrap-reverse;-->
      <div class="radio">
        <input name="flex-wrap" type="radio" class="flex-wrap" id="R21" value="nowrap" checked><label
          for="R21">nowrap:不换行</label>
        <input name="flex-wrap" type="radio" class="flex-wrap" id="R22" value="wrap"><label for="R22">wrap:换行</label>
        <!-- <input name="flex-wrap" type="radio" class="flex-wrap" id="R23" value="wrap-reverse"><label
          for="R23">wrap-reverse:</label> -->
      </div>
    </div>
    <div class="flex-container" id="wrap">
      <div class="item" data-color="2a80b9">
        <p>1</p>
      </div>
      <div class="item" data-color="8f44ad">
        <p>2</p>
      </div>
      <div class="item" data-color="16a086">
        <p>3</p>
      </div>
      <div class="item" data-color="f1c40f">
        <p>4</p>
      </div>
      <div class="item" data-color="e77e23">
        <p>5</p>
      </div>
    </div>

    <div class="control">
      <h4><a href="http://w3.unpocodetodo.info/css3/flex-align-items.php">align-items</a> <small>单行子盒子在侧轴上的对齐方式</small>
      </h4><!-- flex-start | flex-end | center | baseline | stretch;-->
      <div class="radio">
        <input name="flex-align-items" type="radio" class="flex-align-items" id="R31" value="align-items-start"><label
          for="R31">flex-start:侧轴开始</label>
        <input name="flex-align-items" type="radio" class="flex-align-items" id="R32" value="align-items-end"><label
          for="R32">flex-end:侧轴结束</label>
        <input name="flex-align-items" type="radio" class="flex-align-items" id="R33" value="align-items-center"><label
          for="R33">center:居中</label>
        <!-- <input name="flex-align-items" type="radio" class="flex-align-items" id="R34"
          value="align-items-baseline"><label for="R34">baseline:</label> -->
        <input name="flex-align-items" type="radio" class="flex-align-items" id="R35" value="align-items-stretch"
          checked><label for="R35">stretch:拉伸(默认值)</label>
      </div>
    </div>
    <div class="flex-container" id="align">
      <div class="item" data-color="2a80b9">
        <p>1</p>
      </div>
      <div class="item" data-color="8f44ad">
        <p>2</p>
      </div>
      <div class="item" data-color="16a086">
        <p>3</p>
      </div>
      <div class="item" data-color="f1c40f">
        <p>4</p>
      </div>
      <div class="item" data-color="e77e23">
        <p>5</p>
      </div>
    </div>


    <div class="control">
      <h4><a href="http://w3.unpocodetodo.info/css3/flex-justify-content.php">justify-content</a>
        <small>子盒子主轴方向上的对齐方式</small></h4>
      <!--justify-content: flex-start | flex-end | center | space-between | space-around; -->
      <div class="radio">
        <input name="justify-content" type="radio" class="justify-content" id="R41" value="justify-start" checked><label
          for="R41">flex-start:主轴开始</label>
        <input name="justify-content" type="radio" class="justify-content" id="R42" value="justify-end"><label
          for="R42">flex-end:主轴结束</label>
        <input name="justify-content" type="radio" class="justify-content" id="R43" value="justify-space-between"><label
          for="R43">space-between:两端对齐，子盒子之间的间隔都相等。</label>
        <br>
        <input name="justify-content" type="radio" class="justify-content" id="R44" value="justify-center"><label
          for="R44">center:居中</label>
        <input name="justify-content" type="radio" class="justify-content" id="R45" value="justify-space-around"><label
          for="R45">space-around:每个项目两侧的间隔相等。</label>
        <input name="justify-content" type="radio" class="justify-content" id="R46" value="justify-space-evenly"><label
          for="R46">space-evenly: 子元素间隙完全相同</label>
      </div>
    </div>
    <div class="flex-container" id="justify">
      <div class="item" data-color="2a80b9">
        <p>1</p>
      </div>
      <div class="item" data-color="8f44ad">
        <p>2</p>
      </div>
      <div class="item" data-color="16a086">
        <p>3</p>
      </div>
      <div class="item" data-color="f1c40f">
        <p>4</p>
      </div>
      <div class="item" data-color="e77e23">
        <p>5</p>
      </div>

    </div>

    <!--<p>En <strong>Google Chrome</strong> y <strong>Opera</strong>: problemas al cambiar dinamicamente entre <code>justify-content:space-between</code> y <code>justify-content:space-around</code> </p>-->


    <div class="control">
      <h4><a href="http://w3.unpocodetodo.info/css3/flex-align-content.php">align-content</a>
        <small>多行子盒子在侧轴上的对齐方式</small></h4>
      <!--justify-content: flex-start | flex-end | center | space-between | space-around; -->
      <div class="radio">
        <input name="align-content" type="radio" class="align-content" id="R51" value="align-content-start"><label
          for="R51">flex-start:侧轴开始</label>
        <input name="align-content" type="radio" class="align-content" id="R52" value="align-content-end"><label
          for="R52">flex-end:侧轴结束</label>
        <input name="align-content" type="radio" class="align-content" id="R53" value="align-content-center"><label
          for="R53">center:居中</label>
        <input name="align-content" type="radio" class="align-content" id="R54"
          value="align-content-space-between"><label for="R54">space-between:两端对齐，侧轴之间的间隔平均分布。</label>
        <input name="align-content" type="radio" class="align-content" id="R55"
          value="align-content-space-around"><label for="R55">space-around:侧轴之间的间隔平均分布。</label>
        <input name="align-content" type="radio" class="align-content" id="R56" value="align-content-stretch"
          checked><label for="R56">stretch:拉伸(默认值)</label>
      </div>
    </div>
    <div class="flex-container" id="alignContent">

      <div class="item" data-color="1bbc9d">
        <p>1</p>
      </div>
      <div class="item" data-color="2fcc71">
        <p>2</p>
      </div>
      <div class="item" data-color="3598dc">
        <p>3</p>
      </div>
      <div class="item" data-color="9c59b8">
        <p>4</p>
      </div>
      <div class="item" data-color="34495e">
        <p>5</p>
      </div>
      <div class="item" data-color="16a086">
        <p>6</p>
      </div>
      <div class="item" data-color="27ae61">
        <p>7</p>
      </div>
      <div class="item" data-color="2a80b9">
        <p>8</p>
      </div>
      <div class="item" data-color="8f44ad">
        <p>9</p>
      </div>
      <div class="item" data-color="2d3e50">
        <p>10</p>
      </div>
      <div class="item" data-color="f1c40f">
        <p>11</p>
      </div>
      <div class="item" data-color="e77e23">
        <p>12</p>
      </div>
      <div class="item" data-color="e84c3d">
        <p>13</p>
      </div>
      <div class="item" data-color="ecf0f1">
        <p>14</p>
      </div>
      <div class="item" data-color="96a6a6">
        <p>15</p>
      </div>
      <div class="item" data-color="f49c14">
        <p>16</p>
      </div>
      <div class="item" data-color="d55401">
        <p>17</p>
      </div>
      <div class="item" data-color="c1392b">
        <p>18</p>
      </div>
      <div class="item" data-color="bec3c7">
        <p>19</p>
      </div>
      <div class="item" data-color="808b8d">
        <p>20</p>
      </div>

    </div>



  </div>

  <!-- propiedades de los items -->

  <div class="principal">
    <h2>flex布局子元素属性 </h2>

    <div class="control">
      <h4><a href="http://w3.unpocodetodo.info/css3/flex-abreviado.php">flex</a> <small>子元素占用份数</small></h4>
      <!--auto | flex-start | flex-end | center | baseline | stretch -->
      <p>.item { flex: number } </p>
      <table id="flexBasis">
        <tr>
          <td>item1</td>
          <td>item2</td>
        </tr>
        <tr>
          <td><input type="number" class="flex-basis" id="B1" min="0" value="1"><label for="B1">flex: 份数</label>
          </td>
          <td><input type="number" class="flex-basis" id="B2" min="0" value="1"><label for="B2">flex: 份数</label>
          </td>
        </tr>

      </table>
    </div>


    <div class="flex-container align-items-center" id="FCI4">

      <div class="item" id="item1" data-color="f49c14">
        <p>1</p>
      </div>
      <div class="item" id="item2" data-color="d55401">
        <p>2</p>
      </div>

    </div>


    <div class="control">
      <h4><a href="http://w3.unpocodetodo.info/css3/flex-order.php">order</a> <small>定义项目的排列顺序。数值越小，排列越靠前，默认为0。</small>
      </h4>
      <!--auto | flex-start | flex-end | center | baseline | stretch -->
      <div class="radio">
        <span class="nbsp"><label for="R91">item 1: </label><input type="number" class="flex-order" value="0"
            id="R91"></span>
        <span class="nbsp"><label for="R92">item 2: </label><input type="number" class="flex-order" value="0"
            id="R92"></span>
        <span class="nbsp"><label for="R93">item 3: </label><input type="number" class="flex-order" value="0"
            id="R93"></span>
        <span class="nbsp"><label for="R94">item 4: </label><input type="number" class="flex-order" value="0"
            id="R94"></span>
        <span class="nbsp"><label for="R95">item 5: </label><input type="number" class="flex-order" value="0"
            id="R95"></span>
      </div>

    </div>
    <div class="flex-container align-items-center" id="FCI5">


      <div class="item" id="orderR91" data-color="f49c14">
        <p>1</p>
      </div>
      <div class="item" id="orderR92" data-color="d55401">
        <p>2</p>
      </div>
      <div class="item" id="orderR93" data-color="c1392b">
        <p>3</p>
      </div>
      <div class="item" id="orderR94" data-color="bec3c7">
        <p>4</p>
      </div>
      <div class="item" id="orderR95" data-color="808b8d">
        <p>5</p>
      </div>

    </div>


  </div>

  <script src="js/index.js"></script>

</body>

</html>